<?php
class Login_m extends CI_Model{
	
	protected $table = 'users' ;
	protected $logT = 'sess_log';
	
	/*check available user or not*/
	function auth($param){
		$rec = $this->db->get_where($this->table,$param)->row_array();
		if($rec != null) return $rec;
		else  return false;
	}
	/*save data into log users*/
	function savelog($data){
		$this->db->insert($this->logT,$data);
	}
	/*check available in log table*/
	function checkLog($param){
		$rec = $this->db->get_where($this->logT,$param)->row_array();
		if($rec != null) return $rec;
		else  return false;
	}	
	/*if user_id found execute updatelog */
	function updatelog($data,$id){
		$this->db->where('user_id',$id);
		$this->db->update($this->logT,$data);
	}
	function register($data){
		$this->db->insert($this->table,$data);
	}
	function del($id){
		$this->db->where('user_id',$id);
		$this->db->delete($this->table);
	}
}

?>